package sebastiankerckhof.render.raytrace.Hit;

import sebastiankerckhof.math.Vector3f;
import sebastiankerckhof.scene.geometry.Triangle;
import sebastiankerckhof.scene.texture.TexCoord2f;

public class TriangleHit implements HitType{
		public float gamma;
		public float beta;
		public float alpha;
		public Hit h;
	
	 	public TriangleHit(float alpha, float beta, float gamma)
	  {
	 			this.alpha = alpha;
	 			this.beta = beta;
	 			this.gamma = gamma;
	  }
	  
	  @Override
	  public TexCoord2f getTexCoord(){
	  	return ((Triangle)h.surface).getTexCoord(alpha, beta, gamma);
	  }
	  
	  @Override
	  public Vector3f getNormal(){
	  	return ((Triangle) h.surface).getNormal(alpha,beta,gamma);
	  }

		@Override
    public void setHit(Hit h) {
			this.h = h;
    }
	  
  	
	  
	  
}
